package com.fan.txl.data.auth;

import android.databinding.Bindable;
import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;
import com.fan.txl.BR;
import com.fan.txl.data.base.Req;

/**
 * Created by jiajiabao on 17-1-10.
 */
@SuppressWarnings("unused")
public class AuthReq  extends Req implements Parcelable {
    @JSONField(name="userName")
    private String userName;
    @JSONField(name="password")
    private String password;
    @JSONField(name="grantType")
    private String grantType;
    @JSONField(name="scope")
    private String scope;
    @JSONField(name="clientId")
    private String clientId;
    @JSONField(name="clientSecret")
    private String clientSecret;


    public String getGrantType() {
        return grantType;
    }

    public void setGrantType(String grantType) {
        this.grantType = grantType;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public AuthReq() {
    }


    @Bindable
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
        notifyPropertyChanged(BR.userName);
    }
    @Bindable
    public String getPassword() {
        return password;
    }


    public void setPassword(String password) {
        this.password = password;
        notifyPropertyChanged(BR.password);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.userName);
        dest.writeString(this.password);
        dest.writeString(this.grantType);
        dest.writeString(this.scope);
        dest.writeString(this.clientId);
        dest.writeString(this.clientSecret);
    }

    protected AuthReq(Parcel in) {
        this.userName = in.readString();
        this.password = in.readString();
        this.grantType = in.readString();
        this.scope = in.readString();
        this.clientId = in.readString();
        this.clientSecret = in.readString();
    }

    public static final Creator<AuthReq> CREATOR = new Creator<AuthReq>() {
        @Override
        public AuthReq createFromParcel(Parcel source) {
            return new AuthReq(source);
        }

        @Override
        public AuthReq[] newArray(int size) {
            return new AuthReq[size];
        }
    };
}
